home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection Student Program / ADC Tools Sampler CD Disk 3 1999.iso / Metrowerks CodeWarrior / Java Support / Java_Source / Java2 / src / javax / swing / RootPaneContainer.java < prev    next >
Encoding:
Java Source  |  1999-05-28  |  4.4 KB  |  147 lines  |  [TEXT/CWIE]

  1. /*
  2.  * @(#)RootPaneContainer.java    1.9 98/08/26
  3.  *
  4.  * Copyright 1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package javax.swing;
  16.  
  17. import java.awt.Component;
  18. import java.awt.Container;
  19.  
  20.  
  21. /**
  22.  * This interface is implemented by components that have a single
  23.  * JRootPane child: JDialog, JFrame, JWindow, JApplet, JInternalFrame.
  24.  * The methods in  this interface are just <i>covers</i> for the JRootPane 
  25.  * properties, e.g. <code>getContentPane()</code> is generally implemented 
  26.  * like this:<pre>
  27.  *     public Container getContentPane() {
  28.  *         return getRootPane().getContentPane();
  29.  *     }
  30.  * </pre>
  31.  * This interface serves as a <i>marker</i> for Swing GUI builders
  32.  * that need to treat components like JFrame, that contain a
  33.  * single JRootPane, specially.  For example in a GUI builder, 
  34.  * dropping a component on a RootPaneContainer would be interpreted 
  35.  * as <code>frame.getContentPane().add(child)</code>.  
  36.  * 
  37.  * @see JRootPane
  38.  * @see JFrame
  39.  * @see JDialog
  40.  * @see JWindow
  41.  * @see JApplet
  42.  * @see JInternalFrame
  43.  *
  44.  * @version 1.9 08/26/98
  45.  * @author Hans Muller
  46.  */
  47. public interface RootPaneContainer
  48. {
  49.     /**
  50.      * Return this component's single JRootPane child.  A conventional
  51.      * implementation of this interface will have all of the other 
  52.      * methods indirect through this one.  The rootPane has two
  53.      * children: the glassPane and the layeredPane.
  54.      *
  55.      * @return this components single JRootPane child.  
  56.      * @see JRootPane
  57.      */
  58.     JRootPane getRootPane();
  59.  
  60.  
  61.     /**
  62.      * The "contentPane" is the primary container for application 
  63.      * specific components.  Applications should add children to 
  64.      * the contentPane, set its layout manager, and so on.  
  65.      * <p>
  66.      * The contentPane my not be null.
  67.      * <p>
  68.      * Generally implemented with 
  69.      * <code>getRootPane().setContentPane(contentPane);</code>
  70.      * 
  71.      * @exception java.awt.IllegalComponentStateException (a runtime
  72.      *            exception) if the content pane parameter is null
  73.      * @param contentPane the Container to use for the contents of this
  74.      *        JRootPane
  75.      * @see JRootPane#getContentPane
  76.      * @see #getContentPane
  77.      */
  78.     void setContentPane(Container contentPane);
  79.  
  80.  
  81.     /**
  82.      * Returns the contentPane.
  83.      *
  84.      * @return the value of the contentPane property.
  85.      * @see #setContentPane
  86.      */
  87.     Container getContentPane();
  88.  
  89.  
  90.     /**
  91.      * A Container that manages the contentPane and in some cases a menu bar. 
  92.      * The layeredPane can be used by descendants that want to add a child
  93.      * to the RootPaneContainer that isn't layout managed.  For example
  94.      * an internal dialog or a drag and drop effect component.
  95.      * <p>
  96.      * The layeredPane may not be null.
  97.      * <p>
  98.      * Generally implemented with<pre> 
  99.      *    getRootPane().setLayeredPane(layeredPane);</pre>
  100.      * 
  101.      * @exception java.awt.IllegalComponentStateException (a runtime
  102.      *            exception) if the layered pane parameter is null
  103.      * @see #getLayeredPane
  104.      * @see JRootPane#getLayeredPane
  105.      */
  106.     void setLayeredPane(JLayeredPane layeredPane);
  107.  
  108.  
  109.     /**
  110.      * Returns the layeredPane.
  111.      *
  112.      * @return the value of the layeredPane property.
  113.      * @see #setLayeredPane
  114.      */
  115.     JLayeredPane getLayeredPane();
  116.  
  117.  
  118.     /**
  119.      * The glassPane is always the first child of the rootPane
  120.      * and the rootPanes layout manager ensures that it's always
  121.      * as big as the rootPane.  By default it's transparent and
  122.      * not visible.  It can be used to temporarily grab all keyboard 
  123.      * and mouse input by adding listeners and then making it visible.
  124.      * by default it's not visible.
  125.      * <p>
  126.      * The glassPane may not be null.
  127.      * <p>
  128.      * Generally implemented with 
  129.      * <code>getRootPane().setGlassPane(glassPane);</code>
  130.      * 
  131.      * @see #getGlassPane
  132.      * @see JRootPane#setGlassPane
  133.      */
  134.     void setGlassPane(Component glassPane);
  135.  
  136.  
  137.     /**
  138.      * Returns the glassPane.
  139.      *
  140.      * @return the value of the glassPane property.
  141.      * @see #setGlassPane
  142.      */
  143.     Component getGlassPane();
  144.  
  145. }
  146.  
  147.